<template>
	<view>
		<cu-custom bgColor="bg-gradual-blue" :isBack="true">
			<block slot="backText">返回</block>
			<block slot="content">{{ title }}</block>
		</cu-custom>
		<swiper class="screen-swiper round-dot" :indicator-dots="true" :circular="true"
		 :autoplay="true" interval="5000" duration="500">
			<swiper-item v-for="(item,index) in list" :key="index">
				<image :src="item" mode="aspectFill"></image>
			</swiper-item>
		</swiper>
		<view class="padding-bottom-sm"><a-list></a-list></view>	
	</view>
</template>

<script>
	import aList from '@/components/aList'
	import { SlideShow } from '@/common/api/shop'
	import { requestURL } from '@/common/utils/config' 
	export default {
		name:'articleList',
		onLoad(options) {
			if (options.title) this.title = options.title
			this.getList()
		},
		data () {
			return {
				list: [],			
				title: '文章列表'
			}
		},
		methods: {
			getList () {
				uni.showLoading()
				SlideShow().then(res => {
					this.list =  res.data.map(item => {
						item = `${requestURL}/public/static/plat/public/uploads/${item.img}`
						return item
					})
					uni.hideLoading()
				})
			}
		},
		components: { aList },
	}
</script>